<template>
  <div id="huihoudiv">
  <el-tabs v-model="activeNameHuihou" @tab-click="tabClick" tab-position="left">
    <el-tab-pane name="HH_BanZiZhengGai">
      <span slot="label">班子整&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>改清单 <i class="el-icon-caret-bottom"></i></span>
      <div v-if="huihoudata.HH_BanZiZhengGai && huihoudata.HH_BanZiZhengGai.length > 0" style="clear:both">
          <el-button  @click="pinggushow()" style="right:60px;position:fixed;z-index:999" type="success">查看质量评估</el-button>
        <el-card v-for="(item, index) in huihoudata.HH_BanZiZhengGai" :key="index" keys class="" style="margin:0 0 20px 0">
          <div slot="header" class="clearfix">
            <span><b>存在问题&nbsp;{{index+1}}：</b></span>
            <div v-html="item.Cuizaiweiti"></div>
          </div>
          <div class="text item" style="line-height:180%;">
            <b>问题类型：</b>{{item.Wentileixing}}
          </div>
          <hr style="height:1px;border:0;margin:20px 0;background:#EBEEF5;overflow:hidden">
          <div class="text item" style="line-height:180%;font-weight:bolder">
            主要原因：
          </div>
          <div class="text item" style="line-height:180%" v-html="item.Zhuyaoyuanyin">
          </div>
          <hr style="height:1px;border:0;margin:20px 0;background:#EBEEF5;overflow:hidden">
          <div class="text item" style="line-height:180%;">
            <b>整改方向：</b>
          </div>
          <div class="text item" style="line-height:180%" v-html="item.Zhenggaimubiao">
          </div>
          <hr style="height:1px;border:0;margin:20px 0;background:#EBEEF5;overflow:hidden">
          <div class="text item" style="line-height:180%;font-weight:bolder">
            整改措施：
          </div>
          <div class="text item" style="line-height:180%" v-html="item.Cuoshi">
          </div>
          <hr style="height:1px;border:0;margin:20px 0;background:#EBEEF5;overflow:hidden">
          <div class="text item" style="line-height:180%;">
            <b>完成时限：</b>{{item.Wanchengshixian}}&nbsp;&nbsp;&nbsp;&nbsp;<b>负责人：</b>{{item.Zerenren}}&nbsp;&nbsp;&nbsp;&nbsp;<b>落实单位：</b>{{item.Luoshidanwei}}
          </div>
          <hr style="height:1px;border:0;margin:20px 0;background:#EBEEF5;overflow:hidden">
          <div class="text item" style="line-height:180%;font-weight:bolder">
            备注：
          </div>
          <div class="text item" style="line-height:180%">
            {{item.Remark}}
          </div>
        </el-card>
      </div>
      <div v-else style="padding:20px; font-size:14px;color:#999;text-align:center">暂无数据</div>
    </el-tab-pane>
    <el-tab-pane name="HH_ChengYuanZhengGai">
      <span slot="label">班子成员&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>整改清单 <i class="el-icon-caret-bottom"></i></span>
      <div v-if="huihoudata.HH_ChengYuanZhengGai && huihoudata.HH_ChengYuanZhengGai.length > 0">
          <el-button  @click="pinggushow()" style="right:60px;position:fixed;z-index:999" type="success">查看质量评估</el-button>
        <el-radio-group v-model="BanziPersonName" style="margin:20px">
          <el-radio-button label="全部"></el-radio-button>
          <el-radio-button v-for="(item, index) in huihoudata.LingDaoName" :key="index" keys :label="item.name" ></el-radio-button>
        </el-radio-group> 共 <b>{{SumWenti}}</b> 条问题
        <el-card v-for="(item, index) in filterList" :key="index" keys class="" style="margin:0 0 20px 0">
          <div slot="header" class="clearfix">
            <span><b>班子成员姓名：</b><font style="color:#00f">{{item.BanziPersonName}}</font></span>
          </div>
          <div class="text item" style="line-height:180%;font-weight:bolder">
            存在问题（{{item.Tiaoshu}}条）：
          </div>
          <div class="text item" style="line-height:180%" v-html="item.Wenti">
          </div>
          <hr style="height:1px;border:0;margin:20px 0;background:#EBEEF5;overflow:hidden">
          <div class="text item" style="line-height:180%;">
            <b>问题类型：</b>{{item.Leixing}}
          </div>
          <hr style="height:1px;border:0;margin:20px 0;background:#EBEEF5;overflow:hidden">
          <div class="text item" style="line-height:180%;font-weight:bolder">
            整改措施：
          </div>
          <div class="text item" style="line-height:180%" v-html="item.Cuoshi">
          </div>
          <hr style="height:1px;border:0;margin:20px 0;background:#EBEEF5;overflow:hidden">
          <div class="text item" style="line-height:180%;font-weight:bolder">
            目标：
          </div>
          <div class="text item" style="line-height:180%" v-html="item.Mubiao">
          </div>
          <hr style="height:1px;border:0;margin:20px 0;background:#EBEEF5;overflow:hidden">
          <div class="text item" style="line-height:180%;">
            <b>完成时限：</b>{{item.Wanchengshixian}}
          </div>
          <hr style="height:1px;border:0;margin:20px 0;background:#EBEEF5;overflow:hidden">
          <div class="text item" style="line-height:180%;font-weight:bolder">
            备注：
          </div>
          <div class="text item" style="line-height:180%">
            {{item.Remark}}
          </div>
        </el-card>
      </div>
      <div v-else style="padding:20px; font-size:14px;color:#999;text-align:center">暂无数据</div>
    </el-tab-pane>
    <el-tab-pane name="HH_TongBao">
      <span slot="label">通报民主&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>生活会情况 <i class="el-icon-caret-bottom"></i></span>
      <div v-if="huihoudata.HH_TongBao && huihoudata.HH_TongBao.length > 0">
          <el-button  @click="pinggushow()" style="right:60px;position:fixed;z-index:999" type="success">查看质量评估</el-button>

        <el-card v-for="(item, index) in huihoudata.HH_TongBao" :key="index" keys class="" style="margin:0 0 20px 0">
          <div slot="header" class="clearfix">
            <span><b>通报时间：</b><font style="color:#00f">{{item.Tongbaoshijian}}</font></span>&nbsp;&nbsp;&nbsp;&nbsp;
            <span><b>通报方式：</b><font style="color:#00f">{{item.Tongbaofangshi}}</font></span>&nbsp;&nbsp;&nbsp;&nbsp;
            <span><b>通报范围：</b><font style="color:#00f">{{item.Tongbaofanwei}}</font></span>
          </div>
          <div class="text item" style="line-height:180%;font-weight:bolder">
            备注：
          </div>
          <div class="text item" style="line-height:180%">
            {{item.Remark}}
          </div>
        </el-card>
      </div>
      <div v-else style="padding:20px; font-size:14px;color:#999;text-align:center">暂无数据</div>
    </el-tab-pane>
    <el-tab-pane name="HH_HuiYiBaoGao" id="hybg">
      <span slot="label">会议报告 <i class="el-icon-caret-bottom"></i></span>
      <el-form :model="huihoudata.HH_HuiYiBaoGao" label-width="250px" :inline="true" v-if="huihoudata.HH_HuiYiBaoGao">
          <el-button  @click="pinggushow()" style="right:60px;position:fixed;z-index:999" type="success">查看质量评估</el-button>
          <el-form-item label="报告名称：" style="width:1000px;">
            <b>{{huihoudata.HH_HuiYiBaoGao.Baogaomingcheng}}</b>
          </el-form-item>
          <el-form-item label="会议报告是否包括征求意见情况：" style="width:1000px;" label-width="380px">
            <b>{{huihoudata.HH_HuiYiBaoGao.Shifoubaokuoyijian}}</b>
          </el-form-item>
          <el-form-item label="会议报告是否包括开展批评和自我批评情况：" style="width:1000px;" label-width="380px">
            <b>{{huihoudata.HH_HuiYiBaoGao.Shifoubaokuopiping}}</b>
          </el-form-item>
          <el-form-item label="会议报告是否包括检查和反映出的问题及整改措施：" style="width:1000px;" label-width="380px">
            <b>{{huihoudata.HH_HuiYiBaoGao.Shifouzhenggai}}</b>
          </el-form-item>
          <el-form-item label="会议情况报告（附件）：" style="width:1000px;">
            <b>
              <span v-if="huihoudata.HH_HuiYiBaoGao.FileName1&&huihoudata.HH_HuiYiBaoGao.FileName1.length>0">
                <div v-for="(filename,index) in huihoudata.HH_HuiYiBaoGao.FileName1" :key="index">
                  <a href="javascript:void(0)" @click="showfile(filename,huihoudata.HH_HuiYiBaoGao.FilePathName1[index])">{{filename}}</a><br>
                </div>
              </span>
              <span v-else>无</span>
            </b>
          </el-form-item>
          <el-form-item label="会议记录（附件）：" style="width:1000px;">
            <b>
              <span v-if="huihoudata.HH_HuiYiBaoGao.FileName2&&huihoudata.HH_HuiYiBaoGao.FileName2.length>0">
                <div v-for="(filename,index) in huihoudata.HH_HuiYiBaoGao.FileName2" :key="index">
                  <a href="javascript:void(0)" @click="showfile(filename,huihoudata.HH_HuiYiBaoGao.FilePathName2[index])">{{filename}}</a><br>
                </div>
              </span>
              <span v-else>无</span>
            </b>
          </el-form-item>
          <el-form-item label="备注：" style="width:1000px;">
            <b>{{huihoudata.HH_HuiYiBaoGao.Remark}}</b>
          </el-form-item>
          <hr style="height:1px;border:0;margin:20px 0;background:#EBEEF5;overflow:hidden">
          <el-form-item label="报驻部纪检组时间：" style="width:300px;" label-width="170px">
            <b>{{huihoudata.HH_HuiYiBaoGao.Baojijianzushijian}}</b>
          </el-form-item>
          <div></div>
          <el-form-item label="报人事司时间：" style="width:300px;" label-width="170px">
            <b>{{huihoudata.HH_HuiYiBaoGao.Baorenshisishijian}}</b>
          </el-form-item>
          <div></div>
          <el-form-item label="报机关党委时间：" style="width:300px;" label-width="170px">
            <b>{{huihoudata.HH_HuiYiBaoGao.Baojiguandangweishijian}}</b>
          </el-form-item>
          <div></div>
      </el-form>
      <el-form v-else style="padding:20px; font-size:14px;color:#999;text-align:center">暂无数据</el-form>
    </el-tab-pane>
    <el-tab-pane name="HH_PingGuFanKui" id="pgyj">
      <span slot="label">评估意见&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>反馈及整改 <i class="el-icon-caret-bottom"></i></span>
      <el-form :model="huihoudata.HH_PingGuFanKui" :inline="true" v-if="huihoudata.HH_PingGuFanKui" label-width="220px">
          <el-button  @click="pinggushow()" style="right:60px;position:fixed;z-index:999" type="success">查看质量评估</el-button>
          <el-form-item label="反馈时间：" style="width:1000px;">
            <b>{{huihoudata.HH_PingGuFanKui.Fankuishijian}}</b>
          </el-form-item>
          <el-form-item label="评估意见：" style="width:1000px;">
            <div class="text item" style="line-height:180%;font-weight:bolder;padding-top:6px;" v-html="huihoudata.HH_PingGuFanKui.Pingguyijian">
            </div>
          </el-form-item>
          <el-form-item label="整改措施：" style="width:1000px;">
            <div class="text item" style="line-height:180%;font-weight:bolder;padding-top:6px;" v-html="huihoudata.HH_PingGuFanKui.Zhenggaicuoshi">
            </div>
          </el-form-item>
          <el-form-item label="再报人事司时间：" style="width:1000px;">
            <b>{{huihoudata.HH_PingGuFanKui.Zaibaoshijian}}</b>
          </el-form-item>
          <el-form-item label="对评估意见整改情况附件：" style="width:1000px;">
            <b>
              <span v-if="huihoudata.HH_PingGuFanKui.FileName&&huihoudata.HH_PingGuFanKui.FileName.length>0">
                <div v-for="(filename,index) in huihoudata.HH_PingGuFanKui.FileName" :key="index">
                  <a href="javascript:void(0)" @click="showfile(filename,huihoudata.HH_PingGuFanKui.FilePathName[index])">{{filename}}</a><br>
                </div>
              </span>
              <span v-else>无</span>
            </b>
          </el-form-item>
      </el-form>
      <el-form v-else style="padding:20px; font-size:14px;color:#999;text-align:center">暂无数据</el-form>
    </el-tab-pane>
  </el-tabs>
  </div>
</template>
<script>
export default {
  props: {
    timestamp: ''
  },
  data () {
    return {
      activeNameHuihou: 'HH_BanZiZhengGai',
      huihoudata: {},
      listLoading: false,
      BanziPersonName: '全部',
      pdfpage: 1,
      FujianFilename: '',
      pdfviewersrcFujian: '',
      showPDFVisibleFujian: false
    }
  },
  watch: {
    timestamp (val) {
      this.loaddata()
    },
    '$store.state.link_hh' (val) {
      this.activeNameHuihou = this.$store.state.link_hh
    }
    // $refs.tree2.getCurrentNode()
  },
  computed: {
    filterList: function () {
      let key = this.BanziPersonName
      let oldList = this.huihoudata.HH_ChengYuanZhengGai
      if (key === '全部') {
        return oldList
      }
      return oldList.filter(function (item) {
        return item.BanziPersonName === key
      })
    },
    SumWenti: function () {
      let s = 0
      this.filterList.forEach(function (val) {
        s += val.Tiaoshu
      })
      return s
    }
  },
  methods: {
    tabClick () {
      var params = {Link_hh: this.activeNameHuihou}
      this.$store.commit('tablink_hh', params)
    },
    pinggushow () {
      var params1 = {Link1: 'Pingjia'}
      this.$store.commit('tablink1', params1)
    },
    // showfile (filename, filepathname) {
    //   window.open(this.$http.defaults.baseURL + 'shenghuohui/getfujian/' + this.$route.params.id + '?filepathname=' + filepathname + '&t=' + new Date())
    // },
    showfile (filename, filepathname) {
      window.open(this.$http.defaults.baseURL + this.$http.defaults.shenghuohuiAPI + 'api/shenghuohui/getfujian?unitId=' + this.$route.params.id + '&filepathname=' + filepathname + '&t=' + new Date())
    },
    loaddata: function () {
      let _this = this
      _this.listLoading = true
      // let para = {
      //   id: this.$route.params.id
      // }
      // var personParams = { Page: 0, Pagenum: 20, Personname: '', Unitkey: '', Sortkey: '', Isace: true, timestamp: new Date().getTime() }
      this.$http
        // .post(`/shenghuohui/unithuihou`, para)
        .get(this.$http.defaults.shenghuohuiAPI + `api/shenghuohui/unitHuiHou?unitId=` + this.$route.params.id)
        .then(function (response) {
          _this.listLoading = false
          if (response.data.success === true) {
            console.log('获取成功')
            _this.huihoudata = response.data.result
          } else {
            console.log('获取数据失败:' + response.data.message)
            _this.$message({
              message: '获取数据失败:' + response.data.message,
              type: 'error'
            })
          }
        })
        .catch(function (error) {
          console.log(error)
          _this.$message({
            message: '网络获取失败:' + error,
            type: 'error'
          })
          _this.listLoading = false
        })
    }
  }
}
</script>
<style scoped>
.el-form-item{
  margin:0;
}
</style>
<style>
#tab-HH_BanZiZhengGai.el-tabs__item,#tab-HH_ChengYuanZhengGai.el-tabs__item,#tab-HH_TongBao.el-tabs__item,#tab-HH_PingGuFanKui.el-tabs__item{
  height:50px;
  line-height:120%;
  padding-top:10px;
}
#hybg .el-form-item__content,#pgyj .el-form-item__content{
  font-size:16px;
}
#huihoudiv .el-form-item__label{
  font-size:16px;
}
</style>
